package com.jnzc.ocr.serv.shop.api.impl;

import com.jnzc.ocr.common.bean.PageResult;
import com.jnzc.ocr.serv.shop.api.ShopGoodsApi;
import com.jnzc.ocr.serv.shop.entity.ShopGoods;
import com.jnzc.ocr.serv.shop.filter.ShopGoodsFilter;
import com.jnzc.ocr.serv.shop.service.ShopGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangcm
 * @version 1.0, 2017-10-05
 */
@RestController
public class ShopGoodsApiImpl implements ShopGoodsApi {

    @Autowired
    private ShopGoodsService shopGoodsService;

    @Override
    public ShopGoods find(Long id, Long shopId) {
        return shopGoodsService.find(id, shopId);
    }

    @Override
    public List<ShopGoods> list(ShopGoodsFilter filter) {
        return shopGoodsService.list(filter);
    }

    @Override
    public PageResult<ShopGoods> search(@RequestBody ShopGoodsFilter filter, Integer pageNo, Integer pageSize) {
        return shopGoodsService.search(filter, pageNo, pageSize);
    }

    @Override
    public List<ShopGoods> listWarn(Integer warnStockNum, Long shopId) {
        return shopGoodsService.listWarn(warnStockNum, shopId);
    }
}
